function result = GDD(img,img2)
    GD_sum = 0;
    for i=2:256-1
        for j=2:256-1
            GD_temp =abs(img(i,j)-img(i,j-1))+ abs(img(i,j)-img(i,j+1));
            GD_temp = GD_temp + abs(img(i,j)-img(i+1,j))+ abs(img(i,j)-img(i-1,j));
            GD_temp = 0.25 * GD_temp;
            GD_sum = GD_temp + GD_sum;
        end
    end
    result1 = GD_sum / (  (256-2)*(256-2) ) ;
    
    GD_sum2 = 0;
    for i=2:256-1
        for j=2:256-1
            GD_temp2 =abs(img2(i,j)-img2(i,j-1))+ abs(img2(i,j)-img2(i,j+1));
            GD_temp2 = GD_temp2 + abs(img2(i,j)-img2(i+1,j))+ abs(img2(i,j)-img2(i-1,j));
            GD_temp2 = 0.25 * GD_temp2;
            GD_sum2 = GD_temp2 + GD_sum2;
        end
    end
    result2 = GD_sum2 / (  (256-2)*(256-2) ) ;
    
    
    result = (result1 - result2) / (result1 + result2);
    
end